

package at.fhj.itm.metadata.impl.postgres;


import at.fhj.itm.metadata.Constraint;
import at.fhj.itm.metadata.MetadataItem;
import at.fhj.itm.metadata.impl.AbstractMetadataItem;
import java.util.Collections;
import java.util.List;
import static at.fhj.itm.metadata.MetadataUtil.copyMetadataList;
/**
 *
 * @author Seuchter
 */
public class PostgresConstraint extends AbstractMetadataItem implements Constraint {

    private String constraintType;
    private long oid;
    private List<PostgresColumn> columns;
    public PostgresConstraint(long oid, String name, List<PostgresColumn> columns, String constraintType)
    {
        super(name);
        this.oid = oid;
        this.name = name;
        this.columns = columns;
        this.constraintType = constraintType;
    }


    public long getOid()
    {
        return oid;
    }

    public String getConstraintType()
    {
        return constraintType;
    }

    public List<? extends MetadataItem> getChildren()
    {
        return Collections.emptyList();
    }

    public List<PostgresColumn> getConstraintColumns()
    {
        return columns;
    }

    public PostgresConstraint copy() {
        return new PostgresConstraint(-1, getName(),
                copyMetadataList(getConstraintColumns()),getConstraintType());
    }




}
